package com.zkx.fssb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zkx.fssb.domain.dto.AddressDto;
import com.zkx.fssb.domain.po.Address;
import com.zkx.fssb.domain.po.Flower;
import com.zkx.fssb.exception.BaseException;
import com.zkx.fssb.mapper.AddressMapper;
import com.zkx.fssb.service.AddressService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements AddressService {
    @Override
    public List<Address> getByUserId(Integer userId) {

        LambdaQueryWrapper<Address> wrapper =  new LambdaQueryWrapper<>();

        wrapper.eq(Address::getUserId,userId);
        List<Address> addressList = this.getBaseMapper().selectList(wrapper);

        return addressList;


    }

    @Override
    public void customSaveAddress(AddressDto addressDto) {
        Address address = new Address();
        this.save(address);


    }
}
